<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../css/reset.css">
    <style>
        input {
            display: none;
        }

        .menu {
            width: 200px;
        }

        .menu li {
            line-height: 40px;
            /* li上面不能写高度 */
            /* height: 40px; */
            padding-left: 20px;
        }

        .menu li:hover {
            background-color: #eee;
        }

        .hide {
            height: 100px;
            background-color: #ff0;

            height: 0;
            overflow: hidden;
            transition: .2s;
        }

        .menu li input:checked~.hide {
            height: 100px;
        }
    </style>
</head>

<body>
    <ul class="menu">
        <li>
            <input type="checkbox" id="m1">
            <label for="m1">考勤管理</label>
            <div class="hide"></div>
        </li>
        <li>
            <input type="checkbox" id="m2">
            <label for="m2">考勤管理</label>
            <div class="hide"></div>
        </li>
        <li>
            <input type="checkbox" id="m3">
            <label for="m3">考勤管理</label>
        </li>
        <li>
            <input type="checkbox" id="m4">
            <label for="m4">考勤管理</label>
        </li>
    </ul>
</body>

</html>